package com.ruoyi.task.Controller;

import cn.hutool.core.lang.Assert;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.task.service.ApiService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("api")
public class ApiController extends BaseController {

    @Resource
    private ApiService apiService;

    @RequestMapping("search")
    public AjaxResult search(@RequestParam String url){
        Assert.notEmpty(url,"查询链接不能为空!");
        return AjaxResult.success("true",apiService.search(url));
    }
}
